package com.example.mntz.controller;

import com.example.mntz.model.LayuiTable;
import com.example.mntz.model.User;
import com.example.mntz.service.WorldListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("/WorldList")
public class WorldListController {
    @Autowired
    private WorldListService service;
    @RequestMapping("/Investment-WorldList")
    public String html(){
        return "Investment-WorldList";
    }
    @RequestMapping("/WorldList")
    public ResponseEntity<List> worldList(){
        return ResponseEntity.status(200).body(service.selectcg());
    }
    @RequestMapping("/WorldPmList")
    @ResponseBody
    public LayuiTable WorldPmList(@RequestParam("zqId[]")List<Integer> zqId , Integer page, Integer limit, HttpSession session){
        Integer uId = ((User)session.getAttribute("session_user")).getuId();
        return service.selectPmList(zqId,page,limit,uId);
    }
}